#ifndef __DATASTRUCTURE_COMMON_H
#define __DATASTRUCTURE_COMMON_H

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "string.h"

//内存分配失败，溢出处理
#define DataStructure_Overflow_Handler()            	//exit(OVERFLOW)

//内存操作相关函数
#define DataStructure_AllocT(T)                        	DataStructure_Alloc(sizeof (T))
#define DataStructure_Alloc(size)                    	malloc(size)
#define DataStructure_Reallocation(ptr, size)       	realloc(ptr, size)
#define DataStructure_MemoryCpy(b, a, size)           	memcpy(b, a, size)
#define DataStructure_MemoryFree(ptr)               	free(ptr)


#define DataStructure_To(T, e)                        	(*(T*)e)
#define DataStructure_Warning_Unused                	__attribute__((unused))


DataStructure_Warning_Unused
typedef void *T;

DataStructure_Warning_Unused
typedef unsigned char uint8_t;

DataStructure_Warning_Unused
typedef unsigned short uint16_t;

DataStructure_Warning_Unused
typedef unsigned int uin32_t;


typedef enum {
	TRUE = 1,
	FALSE = 0,
	OK = 2,
	//ERROR = 3,
	INFEASIBLE = -1,
	OVERFLOW = -2
} Status;


Status DataStructure_GetValue(void *buf, void *data, size_t dataSize);


#endif        //__DATASTRUCTURE_COMMON_H
 





